package com.verolux.soft.debaraz.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.verolux.soft.debaraz.ApplicationException;
import com.verolux.soft.debaraz.bean.User;
import com.verolux.soft.debaraz.dao.UserDAO;

@Service(value = "userService")
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDAO userDAO;

    /**
     *
     * @param user
     * @throws ApplicationException
     */
    public void insert(User user) throws ApplicationException {
        try {
            userDAO.save(user);
        } catch (Exception e) {
            throw new ApplicationException(e.getMessage(), e);
        }
    }

    /**
     *
     * @param user
     * @throws ApplicationException
     */
    public void delete(User user) throws ApplicationException {
        // TODO Auto-generated method stub
    }

    /**
     *
     * @param email
     * @return
     * @throws ApplicationException
     */
    public User findByUserId(String userId) throws ApplicationException {
        // TODO Auto-generated method stub
        return null;
    }
}
